#ifndef GULLENGINE_INPUTMANAGER
#define GULLENGINE_INPUTMANAGER

#include "Singleton.h"
#include "InputAPI.h"
#include <map>

namespace gull{
	namespace core {
		

		
		typedef std::map<unsigned short, bool> keys;
		typedef std::pair<unsigned short, bool> keyPair;
		
		class InputManager : public Singleton<InputManager>
		{
			
			friend class Singleton<InputManager>;
		public:
			gullNotification initInputContext();
			inline void keyPressed(unsigned short key);
			inline void keyReleased(unsigned short key);
			static inline InputAPI* getInputAPI();
			
			static InputAPI* s_inputAPI;
			
		protected:
			keys m_keys;
			
			
			
		private:
			InputManager();
			~InputManager();
			InputManager(const InputManager& im);
		};
		
		
		InputAPI*
		InputManager::getInputAPI()
		{
			return s_inputAPI;
		}
		
		void 
		InputManager::keyPressed(unsigned short key)
		{
			m_keys.insert(keyPair(key, true));
		}
		
		void 
		InputManager::keyReleased(unsigned short key)
		{
			m_keys[key] = false;
		}
		
	}

}


#endif
